package com.itheima.demo2;

import java.util.ArrayList;

public class StreamDemo1 {

    public static void main(String[] args) {

        ArrayList<String> list = new ArrayList<>();

        list.add("张无忌");
        list.add("周芷若");
        list.add("周总");
        list.add("李总");
        list.add("张三丰");

        list.stream().filter(name -> name.startsWith("张")).filter(name -> name.length() == 3).forEach(s -> System.out.println(s));

    }
}
